<!-- 工单表格 -->

<template>
  <WebTable v-bind="tableProp" noPage>
    <RowText label="处理人" bind="handler" />

    <RowNum label="工单总数" bind="workOrderTotal" sort />

    <RowNum label="按时完成数" bind="ontimeFinish" empty="0" :width="120" sort />

    <OurRowRate bind="ontimeFinishRingRatio" sort />

    <RowNum label="逾期完成数" bind="overdueFinish" empty="0" :width="120" sort />

    <OurRowRate bind="overdueFinishRingRatio" sort />

    <RowNum label="逾期未完成数" bind="overdueUnfinish" empty="0" :width="130" sort />

    <OurRowRate bind="overdueUnfinishRingRatio" sort />

    <RowNum label="0-1小时" bind="hourLevel1" empty="0" />

    <RowNum label="1-3小时" bind="hourLevel2" empty="0" />

    <RowNum label="3小时以上" bind="hourLevel3" empty="0" />

    <RowText label="平均处理时长" bind="averageHour" empty="-" :width="120" />

    <RowSlot label="好评率">
      <template #default="{ row: { ontimeFinish: t1 = 0, overdueFinish: t2 = 0, rate = 0 } }">
        <span v-if="t1 + t2">{{ +((rate * 100) / (t1 + t2)).toFixed(2) }}%</span>
        <span v-else>-</span>
      </template>
    </RowSlot>
  </WebTable>
</template>

<script>
// ============================== 导入依赖 ============================== //

import mixTable from '../../mixTable'
import { index } from '../store/state'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'RepairTable',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [mixTable(index)],
}
</script>
